package com.atguigu.yygh.hosp.controller.admin;

import com.atguigu.yygh.common.result.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Author:hx
 * @DateTime:2022/11/2 10:16
 * @Description:
 */
@RestController
@RequestMapping("/admin/user")
@Slf4j
public class AdminUserController {

    @PostMapping("/login")
    public R login(@RequestBody Map<String,Object> map){
        return R.ok().data("token", "admin-token");
    }

    @GetMapping("/info")
    public R info(String token){
        return R.ok()
                .data("roles", "[admin]")
                .data("introduction", "I am a super administrator")
                .data("avatar", "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif")
                .data("name", "Super Admin");
    }
}
